//
//  BHSportCreateTitleTableViewCell.swift
//  BigHealth
//
//  Created by 蔺百好 on 2021/7/16.
//

import UIKit

class BHSportCreateTitleTableViewCell: UITableViewCell {
    
    var textFieldDidEndEditingBlock:((String) -> Void)?
    

    @IBOutlet weak var title_textFiled: UITextField!
    
    override func awakeFromNib() {
        super.awakeFromNib()
        
        self.title_textFiled.delegate = self
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }
    
}

extension BHSportCreateTitleTableViewCell: UITextFieldDelegate {
    func textFieldShouldReturn(_ textField: UITextField) -> Bool {
        textField.resignFirstResponder()
        return true
    }
    
    func textFieldDidEndEditing(_ textField: UITextField) {
        self.textFieldDidEndEditingBlock?(textField.text ?? "")
    }
}
